import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import render from '@dfeidao/atom-web/render/render';
import p002 from './p002';

export default async function a002(fd: IFeidaoAiBrowserComponent) {// 修改功能的根据责任部门下拉框确定责任人下拉框
	// todo
	console.log('zj-000005:a002----start');

	// 获取责任部门下选择的数据编号
	const n = fd.data.node.querySelector<HTMLSelectElement>('[data-id="duty_department1"]');
	const v = n.value;

	// 根据编号确定责任人下拉框的数据
	const res = await nodejs<Array<{}>>('wyf-hManager/zj-000004/s002', { safety_department_no: v });

	// 渲染
	render(fd, res, p002, 'p002', 'inner');

	console.log('zj-000005:a002----end');
}
